﻿<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
 "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">

<head>

<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" >
<meta http-equiv="Content-Language" content="zh-CN" >
<meta name="keywords" content="海外，圈子，华人，活动" >
<meta name="Description" content="来结识更多的朋友吧" >

<link rel=StyleSheet href="./style/register.css" media = "screen" type="text/css">


<title>花生-注册</title>
<link rel="shortcut icon" href="./images/logo_mini.png">


</head>
<?php
if (isset($_GET['msg'])){
	if ($_GET['msg']="error"){
	session_start();
	$msg=$_SESSION['errmsg'];
	echo $msg;
?>
  <div style="padding:6px; background:#FDE0CE; color:#FD5E5E; 
  font-weight:bold; border:solid 1px #FE9592; text-align:center;">
  !!</div>
 <?php
	}
}
	?>
<body>
<div class="head_t">
	<a href="/huasheng/index.php" ><img src="./images/logo.jpg" width="75" height="55" padding-left="0";/> </a>
	<p style = "display:inline-block"> 来结识新朋友吧 </p>
</div>
<span class="login">已有帐号，<a href="/huasheng/index.php" target="_blank">登录</a></span>
<div class="com">
	
    <div class="left_com">
		
	<form name = "register_form" id="register_form" method = "Post" action="./signup.php" onSubmit="return CheckEmail();">
    <ul class="reg_list_in did_reg" id="register">
      <li>
        <label for="">邮箱</label>
		
		<input class = "box" type="text" name="email" id="email" class="texts" /> 
	    
      </li>
      <li>
        <label for="">创建密码</label>
   
		<input class = "box" name="password" id="password" type="password" class="texts" />
		
      </li>
	   <li>
        <label for="pass2">确认密码</label>
        <input class="box" type="password" name="pass2" id="pass2" onkeyup="checkPass(); return false;" />
		<span id="confirmMessage" class="confirmMessage"></span>
		</li>
	   <li>
        <label for="">真实姓名</label>
   
		<input class = "box" name="name" id="name" type="text" class="texts" />
		
      </li>
	  
	  <li>
	  <label><!--<b class="red">*</b>-->性别</label>

			<input name="gender" type="radio" value="1" checked="checked" />

			<img src="./images/male_icon.jpg" width="25" height="18" align="absmiddle" />

			男士　

			<input name="gender" type="radio" value="0" />

			<img src="./images/female_icon.jpg" width="25" height="18"  align="absmiddle" />

			女士

		</li>
		<li>
		<label> 身份 </label>

		<select class = "box" name="occupation">
		<option value="school" selected = "selected">美国读书中</option>
		<option value="work">美国工作中</option>
		<option value="inchina">已回国</option>
		<option value="others">其他</option>
		</select>
		</li>
		
		<li>
		<label>我的地盘(需添加)</label>
		</li>

	
      <li class="but">
        <input name="btn_register" id="btn_register" type="submit" value="注册" class="register" onclick="CheckEmail();return false;"/>
      </li>
    </ul>
	</form>
							
										<!-- Check confirmed password here-->
										
									
	<script type="text/javascript">
    function checkPass(){
      //Store the password field objects into variables ...
      var pass1 = document.getElementById('password');
      var pass2 = document.getElementById('pass2');
      //Store the Confimation Message Object ...
      var message = document.getElementById('confirmMessage');
      //Set the colors we will be using ...
      var goodColor = "#66cc66";
      var badColor = "#ff6666";
      //Compare the values in the password field 
      //and the confirmation field
      if(password.value == pass2.value){
        //The passwords match. 

        pass2.style.backgroundColor = goodColor;
        message.style.color = goodColor;
        message.innerHTML = ""
      }else{
        //The passwords do not match.

        pass2.style.backgroundColor = badColor;
        message.style.color = badColor;
        message.innerHTML = "";
      }
    }  
	
function echeck(str) {

		var at="@"
		var dot="."
		var lat=str.indexOf(at)
		var lstr=str.length
		var ldot=str.indexOf(dot)
		if (str.indexOf(at)==-1){
		   alert("Invalid E-mail ID")
		   return false
		}

		if (str.indexOf(at)==-1 || str.indexOf(at)==0 || str.indexOf(at)==lstr){
		   alert("Invalid E-mail ID")
		   return false
		}

		if (str.indexOf(dot)==-1 || str.indexOf(dot)==0 || str.indexOf(dot)==lstr){
		    alert("Invalid E-mail ID")
		    return false
		}

		 if (str.indexOf(at,(lat+1))!=-1){
		    alert("Invalid E-mail ID")
		    return false
		 }

		 if (str.substring(lat-1,lat)==dot || str.substring(lat+1,lat+2)==dot){
		    alert("Invalid E-mail ID")
		    return false
		 }

		 if (str.indexOf(dot,(lat+2))==-1){
		    alert("Invalid E-mail ID")
		    return false
		 }
		
		 if (str.indexOf(" ")!=-1){
		    alert("Invalid E-mail ID")
		    return false
		 }

 		 return true					
	}


function CheckEmail(){
	var emailID=document.getElementById("email")
	
	if ((emailID.value==null)||(emailID.value=="")){
		alert("Please Enter your Email ID")
		emailID.focus()
		return false
	}
	if (echeck(emailID.value)==false){
		emailID.value=""
		emailID.focus()
		return false
	}
	document.register_form.submit();
	return true
 }
  </script> 
 
	</div>
	
	<div class="rig_com">
		<div class="ads">
		<img src="./images/logo.jpg" width="125" height="85">
		</div>
		
		<ul>
		<h2>热门学校</h2>
		<!--                   
						Logic to pull hot schools from DB
		
		-->
		<li>
		<a href="#"><img src="./images/schools/wpi.jpg" width="100" height="100"> </a>
		<span class="name"> WPI</span>
		<li>
		<li>
		<a href="#"><img src="./images/schools/harvard.jpg" width="100" height="100"></a>
		<span class="name"> Harvard</span>
		</li>
		<li>
		<a href="#"><img src="./images/schools/bu.jpg" width="100" height="100"></a>
		<span class="name"> Boston U</span>
		</li>
		</ul>

	
	</div>
</div>
</body>
</html>